﻿namespace MEF_Test.Formats.Avi
{
    using System;
    using System.ComponentModel.Composition;
    using System.Windows;

    using MEF_Test.Bricks.StronglyTypedExports;

    /// <summary>
    /// Holds some exports to configure the <see cref="AviMediaHandler"/>.
    /// </summary>
    public class AviMediaHandlerSettings
    {
        static private DataTemplate _aviMediaHandlerDataTemplate;

        static private DataTemplate _aviMediaHandlerDetailDataTemplate;

        /// <summary>
        /// Initializes the <see cref="AviMediaHandlerSettings"/> class.
        /// </summary>
        static AviMediaHandlerSettings()
        {
            ResourceDictionary resourceDictionary = new ResourceDictionary { Source = new Uri("/MEF-Test.Formats.Avi;component/BrowserElementTemplate.xaml", UriKind.Relative) };
            _aviMediaHandlerDataTemplate = (DataTemplate)resourceDictionary["BrowserNodeBaseTemplate"];
            _aviMediaHandlerDetailDataTemplate = (DataTemplate)resourceDictionary["BrowserDetailTemplate"];
        }

        /// <summary>
        /// Gets the avi media handler data template.
        /// </summary>
        /// <value>The avi media handler data template.</value>
        [Export]
        [MediaHandlerTemplateExportAttribute(TemplateGuid = "66d245ab-e247-46d6-b00c-e04b0715e52d", IsDefaultTemplate = true, DefaultTemplateKind = "BrowserItem.Disk.Media.video/avi")]
        public DataTemplate AviMediaHandlerDataTemplate
        {
            get
            {
                return _aviMediaHandlerDataTemplate;
            }           
        }

        /// <summary>
        /// Gets the avi media handler detail data template.
        /// </summary>
        /// <value>The avi media handler detail data template.</value>
        [Export]
        [MediaHandlerTemplateExportAttribute(TemplateGuid = "0DD89829-24F2-42A7-9D0C-A5AA0E793064", IsDefaultTemplate = true, DefaultTemplateKind = "BrowserItem.Disk.Media.Detail.video/avi")]
        public DataTemplate AviMediaHandlerDetailDataTemplate
        {
            get
            {
                return _aviMediaHandlerDetailDataTemplate;
            }
        }  
    }    
}
